package org.lmind.mis.webapp.action;

import java.util.ArrayList;

import org.lmind.mis.privilege.PrivilegeEntry;

public class Register extends BaseAction {

	private static final long serialVersionUID = 5883001811619397528L;

	private String message;
	
	private String userName;

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Override
	protected String executeAction() throws Exception {
		
		message = userName;
		
		PrivilegeEntry e = new PrivilegeEntry();
		e.setId(13);
		e.setName("zzzz");
		
		ArrayList<PrivilegeEntry> l = new ArrayList<PrivilegeEntry>();
		l.add(e);
		
		getPrivilegeService().addPrivilegeEntries(l);
		
		if (message == null || message.equals("")) {
			throw new Exception("no userName");
		}
		
		//PrivilegeEntry e = new Register()
		//PrivilegeEntry a;
		//getPrivilegeService().a

		return SUCCESS;
	}

}
